package cn.edu.zzuli.nothinglink.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author suzyyy
 * @since 2021-04-08
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class Teachers implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "tea_id", type = IdType.AUTO)
    private Integer teaId;

    /**
     * 教师工号
     */
    @NotNull(message = "教师工号不能为空")
    @NotEmpty(message = "教师工号不能为空")
    private String teaNumber;

    /**
     * 教师姓名
     */
    @NotNull(message = "教师姓名不能为空")
    @NotEmpty(message = "教师姓名不能为空")
    private String teaName;

    /**
     * 手机号
     */
    @Length(max = 11, min = 11, message = "传入的手机号码必须是11位")
    @NotNull(message = "手机号不能为空")
    private String teaPhone;

    /**
     * 邮箱
     */
    @Email
    @NotNull(message = "邮箱不能为空")
    private String teaEmail;

    /**
     * 登录密码
     */
    @NotNull(message = "密码不能为空")
    @NotEmpty(message = "密码不能为空")
    private String teaPassword;

    @NotNull(message = "性别不能为空")
    @NotEmpty(message = "性别不能为空")
    private String teaGender;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @TableLogic
    private Integer deleted;


}
